package org.jeecg.modules.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.EnableDict;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;

import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @Author scott
 * @since 2018-12-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "用户", description = "用户")
public class SysUser implements Serializable, EnableDict {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @ApiModelProperty(value = "用户ID")
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 机构ID
     */
    @Excel(name = "机构ID", width = 15)
    @ApiModelProperty(value = "机构ID")
    @Dict(dictTable = "sys_organization", dicCode = "organization_id", dicText = "name")
    private String organizationId;

    /**
     * 登录账号
     */
    @ApiModelProperty(value = "登录账号")
    @Excel(name = "登录账号", width = 15)
    private String username;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;

    /**
     * md5密码盐
     */
    @ApiModelProperty(value = "密码盐")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String salt;

    /**
     * 证件类型
     */
    @Excel(name = "证件类型", width = 15)
    @ApiModelProperty(value = "证件类型")
    @Dict(dicCode = "user_credentials_type")
    private Integer credentialsType;

    /**
     * 证件号码
     */
    @Excel(name = "证件号码", width = 15)
    @ApiModelProperty(value = "证件号码")
    private String credentialsNumber;

    /**
     * 真实姓名
     */
    @ApiModelProperty(value = "真实姓名")
    @Excel(name = "真实姓名", width = 15)
    private String realname;

    /**
     * 登录别名
     */
    @Excel(name = "登录别名", width = 15)
    @ApiModelProperty(value = "登录别名")
    private String nickname;

    /**
     * 电话
     */
    @ApiModelProperty(value = "电话")
    @Excel(name = "电话", width = 15)
    private String phone;

    /**
     * 电子邮件
     */
    @ApiModelProperty(value = "电子邮件")
    @Excel(name = "电子邮件", width = 15)
    private String email;

    /**
     * 状态(1：正常  2：冻结 ）
     */
    @ApiModelProperty(value = "状态")
    @Excel(name = "状态", width = 15, dicCode = "user_status")
    @Dict(dicCode = "user_status")
    private Integer status;

    /**
     * CA证书
     */
    @Excel(name = "CA证书", width = 15)
    @ApiModelProperty(value = "CA证书")
    @Column(name = "CA_certification")
    private String caCertification;

    /**
     * 认证方式
     */
    @Excel(name = "认证方式", width = 15)
    @ApiModelProperty(value = "认证方式")
    @Dict(dicCode = "user_authentication_mode")
    private Integer authenticationMode;

    /**
     * 删除状态（0，正常，1已删除）
     */
    @Excel(name = "删除状态", width = 15, dicCode = "del_flag")
    @TableLogic
    private Integer delFlag;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新人
     */
    private String updateBy;

    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 同步工作流引擎1同步0不同步
     */
    private Integer activitiSync;

    /**
     * 多租户id配置，编辑用户的时候设置
     */
    private String relTenantIds;

    /**
     * 设备id uniapp推送用
     */
//    private String clientId;


}
